# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Metastore.V1.Model.HiveMetastoreConfig do
  @moduledoc """
  Specifies configuration information specific to running Hive metastore software as the metastore service.

  ## Attributes

  *   `auxiliaryVersions` (*type:* `%{optional(String.t) => GoogleApi.Metastore.V1.Model.AuxiliaryVersionConfig.t}`, *default:* `nil`) - Optional. A mapping of Hive metastore version to the auxiliary version configuration. When specified, a secondary Hive metastore service is created along with the primary service. All auxiliary versions must be less than the service's primary version. The key is the auxiliary service name and it must match the regular expression a-z?. This means that the first character must be a lowercase letter, and all the following characters must be hyphens, lowercase letters, or digits, except the last character, which cannot be a hyphen.
  *   `configOverrides` (*type:* `map()`, *default:* `nil`) - Optional. A mapping of Hive metastore configuration key-value pairs to apply to the Hive metastore (configured in hive-site.xml). The mappings override system defaults (some keys cannot be overridden). These overrides are also applied to auxiliary versions and can be further customized in the auxiliary version's AuxiliaryVersionConfig.
  *   `endpointProtocol` (*type:* `String.t`, *default:* `nil`) - Optional. The protocol to use for the metastore service endpoint. If unspecified, defaults to THRIFT.
  *   `kerberosConfig` (*type:* `GoogleApi.Metastore.V1.Model.KerberosConfig.t`, *default:* `nil`) - Optional. Information used to configure the Hive metastore service as a service principal in a Kerberos realm. To disable Kerberos, use the UpdateService method and specify this field's path (hive_metastore_config.kerberos_config) in the request's update_mask while omitting this field from the request's service.
  *   `version` (*type:* `String.t`, *default:* `nil`) - Immutable. The Hive metastore schema version.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :auxiliaryVersions =>
            %{optional(String.t()) => GoogleApi.Metastore.V1.Model.AuxiliaryVersionConfig.t()}
            | nil,
          :configOverrides => map() | nil,
          :endpointProtocol => String.t() | nil,
          :kerberosConfig => GoogleApi.Metastore.V1.Model.KerberosConfig.t() | nil,
          :version => String.t() | nil
        }

  field(:auxiliaryVersions, as: GoogleApi.Metastore.V1.Model.AuxiliaryVersionConfig, type: :map)
  field(:configOverrides, type: :map)
  field(:endpointProtocol)
  field(:kerberosConfig, as: GoogleApi.Metastore.V1.Model.KerberosConfig)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.Metastore.V1.Model.HiveMetastoreConfig do
  def decode(value, options) do
    GoogleApi.Metastore.V1.Model.HiveMetastoreConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Metastore.V1.Model.HiveMetastoreConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
